package com.kitty.spring.kittyUnifiedProcess.controller;

import com.kitty.spring.kittyUnifiedProcess.commons.BaseResult;
import com.kitty.spring.kittyUnifiedProcess.commons.exception.ServiceException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Description 基础的controller类，其他类都继承此类
 * @Author SHEN
 * @Date 2020/10/12
 */
@RestController
public class BaseController {

   private static final Logger LOGGER = LoggerFactory.getLogger(BaseController.class);

   private String  str;

    @GetMapping("/test")
    public BaseResult test(){
        if(true){

            throw new ServiceException("统一异常拦截测试");
        }
        return BaseResult.ok().put("data","hello");
    }


    public static void main(String[] args) {

        LOGGER.trace("trace");
        LOGGER.debug("debugger");
        LOGGER.info("info:{}-{}","hahaha","lalala");
        LOGGER.warn("warn");
        LOGGER.error("错误日志");
    }

}
